﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ScrumPilot.Domain.Models
{
    public class User
    {
        public Int32 ID { get; set; }
        public string Name { get; set; }
        public string Mail { get; set; }
        public string SID { get; set; }
        public string Account { get; set; }
        public Boolean Deleted { get; set; }
        public Boolean IsCurrentUser { get; set; }
        public Boolean Followed { get; set; }
        public Int32 Score { get; set; }
    }

    public class TFSResumeUser
    {
        public string Domain { get; set; }
        public string Mail { get; set; }
        public string Description { get; set; }
        public string Type { get; set; }
        public List<TFSProjectsRolesUser> ProjectRoles { get; set; }
    }

    public class TFSProjectsRolesUser
    {
        public Int32 ID { get; set; }
        public String ProjectName { get; set; }
        public List<TFSRole> Roles { get; set; }

        public String Enumerate
        {
            get
            {
                var s = new StringBuilder();
                Roles.ForEach(pr =>
                {
                    s.Append(pr.Name);
                    s.Append("#");
                });
                s.Remove(s.Length - 1, 1);
                return s.ToString();
            }
        }
    }

    public class TFSRole
    {
        public String Name { get; set; }
        public String Description { get; set; }
    }


    public class UserDetailledWorkItems
    {
        public IList<WorkItemSimpleForUser> UserStories { get; set; }
        public IList<WorkItemSimpleForUser> Tasks { get; set; }
        public IList<WorkItemSimpleForUser> Bugs { get; set; }
        public IList<WorkItemSimpleForUser> CheckOuts { get; set; }
        public Int32 Score { get; set; }
        public Int32 Hours { get; set; }
        public Int32 TotalTasks { get; set; }
        public Int32 Fixedbugs { get; set; }
        public Int32 OpenTasks { get; set; }
    }

    public class WorkItemSimpleForUser
    {
        public long ID { get; set; }
        public string Title { get; set; }
        public string Content { get; set; }
        public string Url { get; set; }
    }
}
